import axios from '@/utils/request';


/**
 * 获取银行流水日志查询分页列表
 */
 export async function QueryBankstatementPageList(params) {
    const res = await axios.post('/Bankstatement/QueryBankstatementPageList',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 根据id获取银行流水日志
 */
 export async function GetBankstatementById(id) {
    const res = await axios.get('/Bankstatement/GetModelById/'+id);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 更新银行流水日志
 */
 export async function UpdateBankstatement(params) {
    const res = await axios.post('/Bankstatement/UpdateBankstatement',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 删除银行流水日志
 */
 export async function DeleteBankstatement(id) {
    const res = await axios.post('/Bankstatement/DeleteBankstatement?id='+id);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

 /**
  * 银行流水
  */
 export async function QueryBankstatementSummaryByCondition(params) {
    const res = await axios.post('/Bankstatement/QueryBankstatementSummaryByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
  }


 /**
  * 银行流水明细
  */
 export async function BankstatementDetailSummaryViewByCondition(params) {
    const res = await axios.post('/Bankstatement/BankstatementDetailSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
  }

 /**
  * 修改银行流水日志信息
  */
 export async function UpdateStatus(params) {
    const res = await axios.post('/Bankstatement/UpdateStatus',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
  }

  /**
  * 导入银行流水日志
  */
 export async function ImportExcel(formData) {
    const res = await axios.post('/Bankstatement/ImportExcel',formData,{headers: {
        'Content-Type': 'multipart/form-data'
       }});
    if (res.data.code === 200) {
        return res.data;
    }
    return Promise.reject(new Error(res.data.msg));
  }

